Description:
MAIOR detects if a value of the index expression is out
of the array's boundary. This message is produced when either the index
expression is negative or if its maximum value is greater
than the maximum value of the accessed array length. It does not produce
this message when the minimum value of the index is less than -127 or when the
difference between the maximum value of the index and array length is
greater than or equal to 127.
Incorrect:
void putchar(char ch) {
bool[] digits = new bool[9];
if (ch >= '0' && ch <= '9') {
digits[ch - '0'] = true; // index may be out of range
digits[ch - '1'] = true; // index may be negative
}
...
}